home *** CD-ROM | disk | FTP | other *** search
- /*
- * SaveBufferAs.ifx.pre
- * Written by Thomas Krehbiel
- *
- * Save main buffer.
- *
- * Inputs:
- * Word(Arg(1),1) = Sequence number (?)
- * Word(Arg(1),2) = Total number of frames (N)
- *
- * Returns:
- * 0 if successful, non-zero on failure
- *
- * Revision History:
- *
- * 25.09.95 tek 2.1a: Fixed JPEG quality setting.
- */
-
- OPTIONS RESULTS
-
- base = 'Autofx_SaveBufferAsJPEG_'
-
- lastpath = GETCLIP(base||'Path')
- lastext = GETCLIP(base||'Ext')
- lastq = GETCLIP(base||'Quality')
-
- IF lastpath = "" THEN DO
- GetPrefs SavePath
- lastpath = result
- END
-
- IF lastext = "" THEN lastext = ".JPG"
- IF lastq = "" THEN lastq = 90
-
- Gadget.1 = 'STRING 120 5 200 14 "Output Path:" "'lastpath'"'
- Gadget.2 = 'FILEREQ 321 5 20 14 "Output Path:" "'lastpath'" AT=1 DIRONLY'
- Gadget.3 = 'STRING 120 20 200 14 "New Extension:" "'lastext'"'
- Gadget.4 = 'TEXT 120 35 1 1 "(** = current frame number)" 1'
- Gadget.5 = 'INTEGER 120 48 50 14 "JPEG Quality:"' lastq 'JU=0'
- Gadget.6 = 'TEXT 180 51 1 1 "(25 - 100)"'
- Gadget.7 = 'END'
-
- NewComplexRequest '"Save Buffer As JPEG"' Gadget 360 68
- IF rc ~= 0 THEN EXIT rc
-
- IF result.5 < 25 THEN result.5 = 25
- IF result.5 > 100 THEN result.5 = 100
-
- CALL SETCLIP(base||'Path', result.1)
- CALL SETCLIP(base||'Ext', result.3)
- CALL SETCLIP(base||'Quality', result.5)
-
- EXIT
-